﻿using LeRenard.ScriptWars.Model.Scripting;
using System;
using System.Collections.Generic;
namespace LeRenard.ScriptWars.Model.Entities
{
    /// <summary>
    /// Represents an entity / creature.
    /// </summary>
    public interface IEntity
    {
        /// <summary>
        /// Unique identifier.
        /// </summary>
        Guid Key { get; }

        /// <summary>
        /// The entity's script.
        /// </summary>
        IScript Script { get; }        

        /// <summary>
        /// Gets the direction the <see cref="IEntity"/> is currently facing.
        /// </summary>
        Direction Direction { get; }

        /// <summary>
        /// Gets the previous operations that've been executed.
        /// </summary>
        IEnumerable<IOperation> PreviousOperations { get; }

        /// <summary>
        /// Resets the previous operation stack.
        /// </summary>
        void ResetPreviousOperations();

        /// <summary>
        /// Performs the next turn for this <see cref="IEntity"/>.
        /// </summary>
        /// <param name="game">The game this entity is part of.</param>
        void NextTurn(IGame game);

        /// <summary>
        /// Changes the entity's direction.
        /// </summary>        
        void ChangeDirection(string direction);
    }
}
